<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html="en">
<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		<link rel="stylesheet" href="static/css/bootstrap-datetimepicker.css" /><!-- 日期框 -->
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		
		<script type="text/javascript">
	
	
	//保存
	function save(){			
		if($("#car_number").val()==""){
			$("#car_number").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_number").focus();
			return false;
		}
		if($("#car_price").val()==""){
			$("#car_price").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_price").focus();
			return false;
		}
		if($("#car_type").val()==""){
			$("#car_type").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_type").focus();
			return false;
		}
		if($("#car_brand").val()==""){
			$("#car_brand").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_brand").focus();
			return false;
		}
		if($("#car_status").val()==""){
			$("#car_status").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_status").focus();
			return false;
		}
		if($("#engine_type").val()==""){
			$("#engine_type").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#engine_type").focus();
			return false;
		}
		if($("#buy_data").val()==""){
			$("#buy_data").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#buy_data").focus();
			return false;
		}
		if($("#car_kilos").val()==""){
			$("#car_kilos").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_kilos").focus();
			return false;
		}
		if($("#car_des").val()==""){
			$("#car_des").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#car_des").focus();
			return false;
		}
		$("#Form").submit();
		$("#zhongxin").hide();
		$("#zhongxin2").show();
	}
	
</script>
</head>
	<body>
		<form action="sysschedule/${msg }.do" name="Form" id="Form" method="post">
		<input type="hidden" id="schedule_id" name="schedule_id" value="${pd.schedule_id }"/>
		<div id="zhongxin">
		<table id="table_report" class="table table-striped table-bordered table-hover">
			<tr>
				<td style="width:80px;text-align: right;padding-top: 13px;">日期:</td>
				<td><input type="text" name="schedule_date" id="schedule_date" readonly="readonly" style="width:200px;" value="${pd.schedule_date}"/></td>
			</tr>
			<tr>
				<td style="width:80px;text-align: right;padding-top: 13px;">开始时间:</td>
				<td><input type="text" name="start_time" id="start_time" class="form_time" readonly="readonly" value="${pd.start_time}" style="width:200px;"/></td>
			</tr>
			<tr>
				<td style="width:80px;text-align: right;padding-top: 13px;">结束时间:</td>
				<td><input type="text" name="end_time" id="end_time" class="form_time" readonly="readonly" value="${pd.end_time}" style="width:200px;"/></td>
			</tr>
			<tr>
				<td style="width:80px;text-align: right;">提醒:</td>
				<td><input type="text" name="remind" id="remind" maxlength="4" style="width:30px;" value="${pd.remind}" />小时提醒我
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="checkbox" name="remind_phone" id="remind_phone" value="1" <c:if test="${pd.remind_phone == 1 }">checked="checked"</c:if> /><span class="lbl">是否手机提醒</span>
				</td>
			</tr>
			<tr>
				<td style="width:80px;text-align: right;padding-top: 13px;">类别:</td>
				<td><select id="remind_type" name="remind_type">
				<option value="1">日志</option>
				<option value="2">审批</option>
				<option value="3">会议</option>
				<option value="4">其他</option>
				</select></td>
			</tr>
			<tr>
				<td style="width:80px;text-align: right;padding-top: 13px;" >标题:</td>
				<td><input type="text" name="schedule_title" id="schedule_title" value="${pd.schedule_title}" /></td>
			</tr>
			<tr>
				<td style="width:80px;text-align: right;padding-top: 13px;">内容:</td>
				<td><textarea name="schedule_detail" id="schedule_detail" rows="5" cols="5" style="resize:none">${pd.schedule_detail}</textarea></td>
			</tr>
			
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
					<c:if test="${msg == 'edit' }">
					<a class="btn btn-mini btn-danger" onclick="del()">删除</a>
					</c:if>
				</td>
			</tr>
		</table>
		</div>
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
		</form>
		
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datetimepicker.js"></script><!-- 日期框 -->
		<script type="text/javascript">
		$(top.hangge());
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.form_time').datetimepicker({
		        language:  'cn',
		        initialDate: $("#schedule_date").val(),
		        format: 'hh:ii',
		        todayBtn:  1,
		        autoclose: true,
		        startView: 1,
		        minView: 0,
		        maxView: 1,
		        forceParse: 0
		    });
		});
		
		function del(){
			var url = "<%=basePath%>sysschedule/delete.do?schedule_id="+$("#schedule_id").val();
			top.jzts();
			$.get(url,function(data){
				if("success" == data){
					parent["mainFrame"].location.href="sysschedule/list.do";
					top.Dialog.close();
				}
			});
		}
		</script>
	</body>
</html>